<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="<?php echo $_BASE_DIR?>css_v1/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $_BASE_DIR?>css_v1/select.css" rel="stylesheet" type="text/css" />
    <!-- tips -->
    <link type="text/css" href="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.tooltip.css" rel="stylesheet">
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.widget.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.position.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>jqmobile/jquery.ui.tooltip.js"></script>
    <!--<script type="text/javascript" src="<?php /*echo $_BASE_DIR*/?>js_v1/jquery.js"></script>-->
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/select-ui.min.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>javascripts/commond.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>baidu_editor/ueditor.config.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/jquery.datetimepicker.js"></script>
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>js_v1/jquery.DatePicker.js"></script>
<!-- 编辑器源码文件 -->
    <script type="text/javascript" src="<?php echo $_BASE_DIR?>baidu_editor/ueditor.all.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="<?php echo $_BASE_DIR?>baidu_editor/lang/zh-cn/zh-cn.js"></script>
<link href="<?php echo $_BASE_DIR?>uploadify/css/uploadify.css" rel="stylesheet" type="text/css" />

<style type="text/css">
#header {
  height: 85px
}

#leftside,#container,#splitBar,#splitBarProxy {
  top: 90px
}
.forminfo li label {
    width: 150px;

}
</style>
<script type="text/javascript">
$(document).ready(function(e) {
    $(".select1").uedSelect({
    width : 345       
  });
  $(".select2").uedSelect({
    width : 167  
  });
  $(".select3").uedSelect({
    width : 110
  });

    //启动tip功能
    $( document ).tooltip({
        position: { my: "left+15 center", at: "right center" }
    });
});
</script>
<script src="<?php echo $_BASE_DIR?>javascripts/jquery.ocupload.min.js"
  type="text/javascript"></script>


  
<script type="text/javascript">
function ajaxpost(form)
{
  var data = $(form).serialize();
  $.post(form.action, data,function(result){
    result =  eval("("+result+")");
    alert(result.message);
    if( result.forwardUrl !== 'null' && result.forwardUrl !== null )
    {
      window.location.href = result.forwardUrl;
    }
    });
  return false;
}
</script>

</head>

<body>

  <div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="<?php echo url("leftmenu/bottom")?>">首页</a></li>
    <li><a href="/">商品规格管理</a></li>
    </ul>
    </div>
    <div class="formbody">
    <div id="usual1" class="usual">
    <div id="tab1" class="tabson">
    <ul class="forminfo">

    <form action="<?php echo url('goodsoption/add')?>" method="post" onsubmit="return ajaxpost(this)">
    
        <?php
              if(empty($goodsoption->id)){
                $goodsoption = new goodsoption();
              }
              $upload_url = url('admin::interface/uploadeditor');
              $host = Helper_Common::getRequestHost();
        ?>

    
        
        <input type="hidden" value="<?php echo $goodsoption->id ?>" name="id" />
        <input type="hidden" value="<?php echo $goodsid ?>" name="goodsid" />
        <li>
        <label>规格名称</label>
        <input type="text" title="商品名称" class="dfinput" style="width:200px;" value="<?php echo $goodsoption->title ?>" name="title" />
        </li>

        <li>
        <label>市场价</label>
        <input type="number" title="市场价" class="dfinput" style="width:200px;" value="<?php echo $goodsoption->marketprice ?>" name="marketprice" />
        </li>

        <li>
        <label>实际售价</label>
        <input type="number" title="实际售价" class="dfinput" style="width:200px;" value="<?php echo $goodsoption->productprice ?>" name="productprice" />
        </li>

        <li>
        <label>库存</label>
        <input type="number" title="库存" class="dfinput" style="width:200px;" value="<?php echo $goodsoption->stock ?>" name="stock" />
        </li>

        <li>
        <label>排序</label>
        <input type="number" title="排序" class="dfinput" style="width:200px;" value="<?php echo $goodsoption->displayorder ?>" name="displayorder" />
        </li>

        <li>
        <label>规格缩略图</label>
        <input type="button" class='jmwup' value="上传文件" id="bproduct_thumb">
        <script type="text/javascript">
        $('#bproduct_thumb').upload({
          action: '<?php echo($upload_url) ?>',
          onComplete: function(data) {
            var obj = eval('('+ data +')');
            if(obj.err == '' && obj.msg.url)
            {
              $('#thumb').val('<?php echo($host) ?>'+obj.msg.url.substr(1));
              alert('上传成功');
            }else{
              alert(obj.err);
            }
          }
        });
        </script>
        <input type="text" title="规格缩略图" id="thumb" class="dfinput" style="width:200px;" value="<?php echo $goodsoption->thumb ?>" name="thumb" />
        </li>



        
  <li><label>&nbsp;</label><input name="" type="submit" class="btn" value="提交"/></li>
    
  
  </form>

</ul></div></div></div></body>
    
   <script type="text/javascript">

    </script>  
    </html>
    
    
